Skip to content

Feature: Pre-Install VS Code extensions in desktop VS Code module #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

yashksaini-coder
Copy link

/claim #207

Closes #207

Description

  • Add extensions parameter to automatically install the VS-Code extensions
  • Add settings parameter for workspace-specific configuration
  • Create setup.sh script to install extensions & settings management
  • Add validation for extension format (publisher.extension-name)
  • Update test to the coverage for new features
  • Support graceful fallback when VS Code CLI is unavailable

This pull request introduces functionality to automate the setup of Visual Studio Code (VS Code) workspaces, including the installation of extensions and configuration of workspace settings. It adds new Terraform variables and resources, a setup script, and corresponding tests to ensure proper behavior.

Terraform Module Enhancements:

  • Added extensions, settings, and install_extensions variables to allow users to specify VS Code extensions, workspace settings, and control automatic installation behavior. Validation ensures proper formatting for extensions. (registry/coder/modules/vscode-desktop/main.tf, registry/coder/modules/vscode-desktop/main.tfR41-R85)
  • Introduced a coder_script resource that dynamically creates a setup script to install extensions and configure settings when applicable. (registry/coder/modules/vscode-desktop/main.tf, registry/coder/modules/vscode-desktop/main.tfR41-R85)

Setup Script:

  • Implemented a comprehensive Bash script (setup.sh) to handle the installation of extensions, configuration of workspace settings, and creation of extension recommendations. The script includes robust error handling, logging, and validation mechanisms. (registry/coder/modules/vscode-desktop/setup.sh, registry/coder/modules/vscode-desktop/setup.shR1-R267)

Documentation Updates:

Testing:

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/vscode-desktop
New version: v1.0.0
Breaking change: [ ] Yes [X] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally

Related Issues

None

@yashksaini-coder
Copy link
Author

@matifali can you please review the PR

if [ -x "$path" ]; then
export PATH="$PATH:$(dirname "$path")"
return 0
fi
done

# Try to install VS Code Desktop (which provides the CLI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

I think we only need the CLI and not the full VS Code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yashksaini-coder Another option is to not install the code CLI at all and direct download and place extensions VSIX files in the --extensions-dir directory.
We can take that as input to the moudle with a sane default.

Additionally, downloading extensions directly would work with Other VSCode-based IDEs, such as Cursor, WindSurf, and Kiro.

WDYT?

See: https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_command-line-extension-management

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install the CLI instead of full VSCode
https://code.visualstudio.com/download

@yashksaini-coder
Copy link
Author

@matifali understood let me work on this

@bpmct
Copy link
Member

bpmct commented Jul 19, 2025

Hey @yashksaini-coder - can you please submit a video of this working in a coder deployment once those fixes are made?

@yashksaini-coder
Copy link
Author

Hey @yashksaini-coder - can you please submit a video of this working in a coder deployment once those fixes are made?

I'm on windows and have performing testing on my code. Haven't been able to deploy properly

@yashksaini-coder yashksaini-coder deleted the feature/pre-install branch July 21, 2025 08:34
@yashksaini-coder
Copy link
Author

@matifali @bpmct I will close this PR, and start again on scratch, discontinued in middle due to end sem exams. so going to start fresh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-install VS Code extensions in desktop VS Code module
3 participants